package the_Crash.Stylists;

import java.awt.Color;
import repast.simphony.visualizationOGL2D.DefaultStyleOGL2D;
import saf.v3d.scene.VSpatial;

public class SignalStylist extends DefaultStyleOGL2D {
	
	@Override
	public VSpatial getVSpatial(Object agent, VSpatial spatial) {		
		if (spatial == null) {
			spatial = shapeFactory.createRectangle(5, 5);
		}
		return spatial;
	}
	
	@Override
	public Color getColor(Object agent) {
		SignalUnit su = (SignalUnit) agent;
		return su.isActive()? Color.green: Color.red;
	}
	
}
